function sendSms(pars){
	var mask = mui.createMask(function(){
	});//callback为用户点击蒙版时自动执行的回调；
	mask.show();//显示遮罩
	
	//CmwMcore.disabled('sendsms');
	var url = UrlConfig.msms_index;
	$.ajax(url, {  
        data : pars,  
        dataType : 'jsonp',  
        crossDomain: true,  
        success: function(data) {
        		data = JSON.parse(data);
        		sms_callback(data.msg);
        		mask.close();
        },
        error : function(req,textStatus, errorThrown){
        		mask.close();
        		mui.alert("验证码不对，请重新填写！"); 
        }
    });
}

function sms_callback(msg){
	if(msg==1){
		mui.alert("短信发送成功！");
		fun_timedownn(300);
		//$('#sendsms').attr('href','javascript:void(0)');
		statusglobal3 = true;
	}else if(msg == 0){
		 $("#sendsms").html("重新获取");
		mui.alert("短信发送失败");
	}else if(msg==2){
		 $("#sendsms").html("重新获取");
		mui.alert("发送频率过高，2分钟之内不能重复发送");
	}else if(msg==3){
		 $("#sendsms").html("重新获取");
		mui.alert("没有要发送的号码");
	}else if(msg==4){
		 $("#sendsms").html("重新获取");
		mui.alert("您还没有登录呢，不能发送短信");
	}
}
var timerId = null;
function fun_timedownn(time)  {
    if(!time && time !== 0) time = 300;
    $("#sendsms").html(time+"秒");
    
    time = time-1;
    if(time>=0){
       timerId = window.setTimeout("fun_timedownn("+time+")",1000);
    }else {
    	 $("#sendsms").html("重新获取");
    }
}

function stopTimer(){
	if(timerId) window.clearTimeout(timerId);
}


